package IGU;

import javax.swing.JFrame;
import logica.FuncionesGUI;

/**
 * @author Cristian
 */
public class MostrarPeliculas extends javax.swing.JFrame {

    /** Creates new form MostrarPeliculas */
    public MostrarPeliculas()
    {
        initComponents();
        initMyOwnComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollBar1 = new javax.swing.JScrollBar();
        jCBListaPeliculas = new javax.swing.JComboBox();
        jLabel1 = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jLabel11 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel14 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jLabel8 = new javax.swing.JLabel();
        jLabel4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        JTFGenero = new javax.swing.JTextField();
        JTFDuracion = new javax.swing.JTextField();
        JTFLanzamiento = new javax.swing.JTextField();
        jScrollPane1 = new javax.swing.JScrollPane();
        JTASinopsis = new javax.swing.JTextArea();
        JTFSubtitulos = new javax.swing.JTextField();
        JTFIdioma = new javax.swing.JTextField();
        jLabel15 = new javax.swing.JLabel();
        jTRanking = new javax.swing.JTextField();
        jLimagen = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        JTFNombreOriginaPelicula = new javax.swing.JTextField();
        JTFNombrePelicula = new javax.swing.JTextField();
        jCReparto = new javax.swing.JComboBox();
        jCDirectores = new javax.swing.JComboBox();
        JTFGuionista = new javax.swing.JTextField();
        JTFProductora = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();

        jScrollBar1.setName("jScrollBar1"); // NOI18N

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        jCBListaPeliculas.setName("jCBListaPeliculas"); // NOI18N
        jCBListaPeliculas.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCBListaPeliculasActionPerformed(evt);
            }
        });
        getContentPane().add(jCBListaPeliculas, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 50, 302, -1));

        jLabel1.setFont(new java.awt.Font("Verdana", 1, 14));
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Películas Disponibles");
        jLabel1.setName("jLabel1"); // NOI18N
        getContentPane().add(jLabel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(270, 11, -1, -1));

        jLabel13.setForeground(new java.awt.Color(255, 255, 255));
        jLabel13.setText("Guionista:");
        jLabel13.setName("jLabel13"); // NOI18N
        getContentPane().add(jLabel13, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 294, -1, -1));

        jLabel12.setForeground(new java.awt.Color(255, 255, 255));
        jLabel12.setText("Director(es):");
        jLabel12.setName("jLabel12"); // NOI18N
        getContentPane().add(jLabel12, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 251, -1, -1));

        jLabel11.setForeground(new java.awt.Color(255, 255, 255));
        jLabel11.setText("Género:");
        jLabel11.setName("jLabel11"); // NOI18N
        getContentPane().add(jLabel11, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 369, -1, -1));

        jLabel10.setForeground(new java.awt.Color(255, 255, 255));
        jLabel10.setText("Duracion:");
        jLabel10.setName("jLabel10"); // NOI18N
        getContentPane().add(jLabel10, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 412, -1, -1));

        jLabel9.setForeground(new java.awt.Color(255, 255, 255));
        jLabel9.setText("Lanzamiento (año): ");
        jLabel9.setName("jLabel9"); // NOI18N
        getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 436, -1, -1));

        jLabel14.setForeground(new java.awt.Color(255, 255, 255));
        jLabel14.setText("Reparto:");
        jLabel14.setName("jLabel14"); // NOI18N
        getContentPane().add(jLabel14, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 209, -1, -1));

        jLabel3.setForeground(new java.awt.Color(255, 255, 255));
        jLabel3.setText("Nombre:");
        jLabel3.setName("jLabel3"); // NOI18N
        getContentPane().add(jLabel3, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 120, -1, -1));

        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setText("Subtítulos");
        jLabel6.setName("jLabel6"); // NOI18N
        getContentPane().add(jLabel6, new org.netbeans.lib.awtextra.AbsoluteConstraints(446, 383, 101, -1));

        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setText("Sinopsis:");
        jLabel7.setName("jLabel7"); // NOI18N
        getContentPane().add(jLabel7, new org.netbeans.lib.awtextra.AbsoluteConstraints(446, 195, -1, -1));

        jLabel8.setForeground(new java.awt.Color(255, 255, 255));
        jLabel8.setText("Idioma:");
        jLabel8.setName("jLabel8"); // NOI18N
        getContentPane().add(jLabel8, new org.netbeans.lib.awtextra.AbsoluteConstraints(446, 343, -1, -1));

        jLabel4.setForeground(new java.awt.Color(255, 255, 255));
        jLabel4.setText("Nombre original:");
        jLabel4.setName("jLabel4"); // NOI18N
        getContentPane().add(jLabel4, new org.netbeans.lib.awtextra.AbsoluteConstraints(70, 160, -1, 10));

        jLabel5.setForeground(new java.awt.Color(255, 255, 255));
        jLabel5.setText("Poster:");
        jLabel5.setName("jLabel5"); // NOI18N
        getContentPane().add(jLabel5, new org.netbeans.lib.awtextra.AbsoluteConstraints(430, 60, -1, -1));

        JTFGenero.setName("JTFGenero"); // NOI18N
        getContentPane().add(JTFGenero, new org.netbeans.lib.awtextra.AbsoluteConstraints(160, 368, 160, -1));

        JTFDuracion.setName("JTFDuracion"); // NOI18N
        getContentPane().add(JTFDuracion, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 406, 100, -1));

        JTFLanzamiento.setName("JTFLanzamiento"); // NOI18N
        getContentPane().add(JTFLanzamiento, new org.netbeans.lib.awtextra.AbsoluteConstraints(220, 432, 100, -1));

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        JTASinopsis.setColumns(20);
        JTASinopsis.setRows(5);
        JTASinopsis.setName("JTASinopsis"); // NOI18N
        jScrollPane1.setViewportView(JTASinopsis);

        getContentPane().add(jScrollPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(446, 215, -1, 110));

        JTFSubtitulos.setName("JTFSubtitulos"); // NOI18N
        getContentPane().add(JTFSubtitulos, new org.netbeans.lib.awtextra.AbsoluteConstraints(546, 383, 101, -1));

        JTFIdioma.setName("JTFIdioma"); // NOI18N
        getContentPane().add(JTFIdioma, new org.netbeans.lib.awtextra.AbsoluteConstraints(546, 343, 101, -1));

        jLabel15.setForeground(new java.awt.Color(255, 255, 255));
        jLabel15.setText("Ranking:");
        jLabel15.setName("jLabel15"); // NOI18N
        getContentPane().add(jLabel15, new org.netbeans.lib.awtextra.AbsoluteConstraints(446, 435, -1, -1));

        jTRanking.setName("jTRanking"); // NOI18N
        getContentPane().add(jTRanking, new org.netbeans.lib.awtextra.AbsoluteConstraints(546, 414, 101, -1));

        jLimagen.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 1, true));
        jLimagen.setName("jLimagen"); // NOI18N
        getContentPane().add(jLimagen, new org.netbeans.lib.awtextra.AbsoluteConstraints(492, 29, 120, 160));

        jPanel1.setBackground(new java.awt.Color(51, 51, 51));
        jPanel1.setName("jPanel1"); // NOI18N

        jButton1.setText("Aceptar");
        jButton1.setName("jButton1"); // NOI18N
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        JTFNombreOriginaPelicula.setName("JTFNombreOriginaPelicula"); // NOI18N
        JTFNombreOriginaPelicula.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTFNombreOriginaPeliculaActionPerformed(evt);
            }
        });

        JTFNombrePelicula.setName("JTFNombrePelicula"); // NOI18N
        JTFNombrePelicula.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                JTFNombrePeliculaActionPerformed(evt);
            }
        });

        jCReparto.setName("jCReparto"); // NOI18N

        jCDirectores.setName("jCDirectores"); // NOI18N

        JTFGuionista.setName("JTFGuionista"); // NOI18N

        JTFProductora.setName("JTFProductora"); // NOI18N

        jLabel2.setForeground(new java.awt.Color(255, 255, 255));
        jLabel2.setText("Productora:");
        jLabel2.setName("jLabel2"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(67, 67, 67)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(JTFNombrePelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(JTFNombreOriginaPelicula, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jButton1)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addGap(45, 45, 45)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jCDirectores, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jCReparto, javax.swing.GroupLayout.PREFERRED_SIZE, 212, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JTFGuionista, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(JTFProductora, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(112, 112, 112)
                .addComponent(JTFNombrePelicula, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(JTFNombreOriginaPelicula, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(31, 31, 31)
                .addComponent(jCReparto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(28, 28, 28)
                .addComponent(jCDirectores, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(JTFGuionista, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(JTFProductora, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel2))
                .addGap(135, 135, 135)
                .addComponent(jButton1))
        );

        getContentPane().add(jPanel1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 700, 540));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jCBListaPeliculasActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCBListaPeliculasActionPerformed

        // FuncionesBasicasGUI.cargarInformacionUsuario(jCBListaUsuarios.getSelectedIndex()-1, jTFNombre, jTFApellido, jTFNivelPermisologia);
        
        FuncionesGUI.cargarInformacionPelicula(jCReparto,jCDirectores,jCBListaPeliculas.getSelectedIndex()-1, JTFNombrePelicula, JTFNombreOriginaPelicula, JTFGuionista, JTFProductora, JTFGenero, JTFDuracion, JTFLanzamiento, JTASinopsis, JTFIdioma, JTFSubtitulos, jTRanking,jLimagen);

        // TODO add your handling code here:
}//GEN-LAST:event_jCBListaPeliculasActionPerformed

    private void JTFNombrePeliculaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTFNombrePeliculaActionPerformed
        // TODO add your handling code here:
}//GEN-LAST:event_JTFNombrePeliculaActionPerformed

    private void JTFNombreOriginaPeliculaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_JTFNombreOriginaPeliculaActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_JTFNombreOriginaPeliculaActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        FuncionesGUI.habilitarVentana(this.ventanaPadre, true, true);
        this.dispose();
        // TODO add your handling code here:
    }//GEN-LAST:event_jButton1ActionPerformed

    private void initMyOwnComponents()
    {

        FuncionesGUI.inicializarCombo (jCBListaPeliculas, "Seleccione una Película");
        FuncionesGUI.cargarListaPeliculasEnCombo (jCBListaPeliculas, false);
    }

    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new MostrarPeliculas().setVisible(true);
            }
        });
    }




    public JFrame getVentanaPadre()
    {
        return ventanaPadre;
    }

    public void setVentanaPadre(JFrame ventanaPadre)
    {
        this.ventanaPadre = ventanaPadre;
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextArea JTASinopsis;
    private javax.swing.JTextField JTFDuracion;
    private javax.swing.JTextField JTFGenero;
    private javax.swing.JTextField JTFGuionista;
    private javax.swing.JTextField JTFIdioma;
    private javax.swing.JTextField JTFLanzamiento;
    private javax.swing.JTextField JTFNombreOriginaPelicula;
    private javax.swing.JTextField JTFNombrePelicula;
    private javax.swing.JTextField JTFProductora;
    private javax.swing.JTextField JTFSubtitulos;
    private javax.swing.JButton jButton1;
    private javax.swing.JComboBox jCBListaPeliculas;
    private javax.swing.JComboBox jCDirectores;
    private javax.swing.JComboBox jCReparto;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLimagen;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollBar jScrollBar1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextField jTRanking;
    // End of variables declaration//GEN-END:variables
private JFrame ventanaPadre;
}
